﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 影片售票系统.Yly
{
    public partial class BuySeat : Form
    {
        public BuySeat()
        {
            InitializeComponent();
        }

        private void BuySeat_Load(object sender, EventArgs e)
        {
            #region 动态生成座位图片
            for (int i = 1; i <= 12; i++)
            {
                PictureBox pict = new PictureBox();
                pict.Location = new Point(40 * i, 40);
                pict.Image = imageList1.Images[0];
                pict.Size = new Size(40, 40);
                pict.SizeMode = PictureBoxSizeMode.Zoom;
                pict.Click += pict_Click;
                pict.DoubleClick += pict_DoubleClick;
                this.Controls.Add(pict);
            }

            for (int i = 1; i <= 12; i++)
            {
                PictureBox pict1 = new PictureBox();
                pict1.Location = new Point(40 * i, 80);
                pict1.Image = imageList1.Images[0];
                pict1.Size = new Size(40, 40);
                pict1.SizeMode = PictureBoxSizeMode.Zoom;
                pict1.Click += pict1_Click;
                pict1.DoubleClick += pict1_DoubleClick;
                this.Controls.Add(pict1);
            }

            for (int i = 1; i <= 12; i++)
            {
                PictureBox pict2 = new PictureBox();
                pict2.Location = new Point(40 * i, 120);
                pict2.Image = imageList1.Images[0];
                pict2.Size = new Size(40, 40);
                pict2.SizeMode = PictureBoxSizeMode.Zoom;
                pict2.Click += pict2_Click;
                pict2.DoubleClick += pict2_DoubleClick;
                this.Controls.Add(pict2);
            }
            for (int i = 1; i <= 12; i++)
            {
                PictureBox pict3 = new PictureBox();
                pict3.Location = new Point(40 * i, 160);
                pict3.Image = imageList1.Images[0];
                pict3.Size = new Size(40, 40);
                pict3.SizeMode = PictureBoxSizeMode.Zoom;
                pict3.Click += pict3_Click;
                pict3.DoubleClick += pict3_DoubleClick;
                this.Controls.Add(pict3);
            }

            for (int i = 1; i <= 12; i++)
            {
                PictureBox pict4 = new PictureBox();
                pict4.Location = new Point(40 * i, 200);
                pict4.Image = imageList1.Images[0];
                pict4.Size = new Size(40, 40);
                pict4.SizeMode = PictureBoxSizeMode.Zoom;
                pict4.Click += pict4_Click;
                pict4.DoubleClick += pict4_DoubleClick;
                this.Controls.Add(pict4);
            }
            for (int i = 1; i <= 12; i++)
            {
                PictureBox pict5 = new PictureBox();
                pict5.Location = new Point(40 * i, 240);
                pict5.Image = imageList1.Images[0];
                pict5.Size = new Size(40, 40);
                pict5.SizeMode = PictureBoxSizeMode.Zoom;
                pict5.Click += pict5_Click;
                pict5.DoubleClick += pict5_DoubleClick;
                this.Controls.Add(pict5);
            }
            for (int i = 1; i <= 12; i++)
            {
                PictureBox pict6 = new PictureBox();
                pict6.Location = new Point(40 * i, 280);
                pict6.Image = imageList1.Images[0];
                pict6.Size = new Size(40, 40);
                pict6.SizeMode = PictureBoxSizeMode.Zoom;
                pict6.Click += pict6_Click;
                pict6.DoubleClick += pict6_DoubleClick;
                this.Controls.Add(pict6);
            }
            for (int i = 1; i <= 12; i++)
            {
                PictureBox pict7 = new PictureBox();
                pict7.Location = new Point(40 * i, 320);
                pict7.Image = imageList1.Images[0];
                pict7.Size = new Size(40, 40);
                pict7.SizeMode = PictureBoxSizeMode.Zoom;
                pict7.Click += pict7_Click;
                pict7.DoubleClick += pict7_DoubleClick;
                this.Controls.Add(pict7);
            }


            #endregion

           
        }

        void pict7_DoubleClick(object sender, EventArgs e)
        {
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[0];
        }

        void pict6_DoubleClick(object sender, EventArgs e)
        {
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[0];
        }

        void pict5_DoubleClick(object sender, EventArgs e)
        {
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[0];
        }

        void pict4_DoubleClick(object sender, EventArgs e)
        {
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[0];
        }

        void pict3_DoubleClick(object sender, EventArgs e)
        {
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[0];
        }

        void pict2_DoubleClick(object sender, EventArgs e)
        {
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[0];
        }

        void pict1_DoubleClick(object sender, EventArgs e)
        {
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[0];
        }

        void pict_DoubleClick(object sender, EventArgs e)
        {
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[0];
        }
        #region 单击选座
        void pict7_Click(object sender, EventArgs e)
        {
        
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[1];
        }

        void pict6_Click(object sender, EventArgs e)
        {
         
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[1];
        }

        void pict5_Click(object sender, EventArgs e)
        {
          
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[1];
        }

        void pict4_Click(object sender, EventArgs e)
        {
      
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[1];
        }

        void pict3_Click(object sender, EventArgs e)
        {
     
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[1];
        }

        void pict2_Click(object sender, EventArgs e)
        {
       
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[1];
        }

        void pict1_Click(object sender, EventArgs e)
        {
       
            PictureBox pict = sender as PictureBox;
            pict.Image = imageList1.Images[1];
        }
       
        void pict_Click(object sender, EventArgs e)
        {
            PictureBox pict = sender as PictureBox;
             pict.Image = imageList1.Images[1];        
        }
        #endregion

        private void label1_Click(object sender, EventArgs e)
        {

        }
    }
}
